import request from '@/utils/request';
import Qs from "qs"
export function pointPositionList(data) {
    // let {
    //   is_online = 0,
    //   mid_table_remark_001_like = "",
    //   mid_table_remark_002_like = "",
    //   mid_table_remark_003_like = "",
    //   id_public_middle_table = "",
    // } = data;
    let temp = {
        invoke_method: 'public_load_middle_table_list',
        pre_db_para_middle_table_name: 'public_middle_table_lite_mod_express_locker',
        pre_db_para_begin_idx: 0,
        pre_db_para_length_4_list: 10,
        is_online: 0,
    }
    let queryData = Qs.stringify(Object.assign(postData, data));
    return request({
        url: '/duzikai_api_mgr_public_middle_table',
        method: 'post',
        data: queryData
    })
}
// 新增/编辑/删除点位
export function pointPositionMgr(data) {
    if (!data) {
        return Promise.reject();
    }
    let {
        mid_table_remark_001 = "",
            mid_table_remark_002 = "",
            mid_table_remark_003 = "",
            mid_table_remark_004 = "",
            mid_table_remark_005 = "",
            mid_table_remark_006 = "",
            mid_table_remark_007 = "",
            mid_table_remark_040 = "",
            mid_table_remark_041 = "",
            mid_table_remark_042 = "",
            mid_table_remark_043 = "",
            pre_db_para_id_public_middle_table = "",
            is_online = 0,
            type_inner_app = 1001,
            type_middle_app = 141001,
            pre_db_para_middle_table_name = 'public_middle_table_lite_mod_express_locker',
            invoke_method = 'public_insert_or_update_middle_table'
    } = data;
    //duzikai_api_mgr_public_middle_table?invoke_method=public_insert_or_update_middle_table&pre_db_para_middle_table_name=public_middle_table_lite_mod_express_locker&type_middle_app=141001&type_inner_app=1001
    let postData = {
        invoke_method,
        pre_db_para_middle_table_name,
        type_middle_app,
        type_inner_app,
        is_online,
        mid_table_remark_001,
        mid_table_remark_002,
        mid_table_remark_003,
        mid_table_remark_004,
        mid_table_remark_005,
        mid_table_remark_006,
        mid_table_remark_007,
        mid_table_remark_040,
        mid_table_remark_041,
        mid_table_remark_042,
        mid_table_remark_043,
    }
    if (pre_db_para_id_public_middle_table) {
        postData.pre_db_para_id_public_middle_table = pre_db_para_id_public_middle_table;
    }
    return request({
        url: '/duzikai_api_mgr_public_middle_table',
        method: 'post',
        data: Qs.stringify(postData)
    })
}
// 编辑/删除点位联动
export function pointPositionLinkage(data) {
    if (!data) {
        return Promise.reject();
    }
    let {
        mid_table_remark_001 = "",
            mid_table_remark_002 = "",
            mid_table_remark_003 = "",
            mid_table_remark_004 = "",
            mid_table_remark_005 = "",
            mid_table_remark_006 = "",
            mid_table_remark_007 = "",
            is_online = 0,
            type_inner_app = 1001,
            type_middle_app = 141001,
            pre_db_para_mid_table_remark_008 = "",
            pre_db_para_id_public_middle_table = -1,
            pre_db_para_type_middle_app_in = '142001,143001',
            pre_db_para_middle_table_name = 'public_middle_table_lite_mod_express_locker',
            invoke_method = 'public_load_middle_table_list'
    } = data;
    //duzikai_api_mgr_public_middle_table?invoke_method=public_insert_or_update_middle_table&pre_db_para_middle_table_name=public_middle_table_lite_mod_express_locker&type_middle_app=141001&type_inner_app=1001
    let postData = {
        invoke_method,
        pre_db_para_middle_table_name,
        pre_db_para_type_middle_app_in,
        pre_db_para_mid_table_remark_008,
        is_online,
        mid_table_remark_001,
        mid_table_remark_002,
        mid_table_remark_003,
        mid_table_remark_004,
        mid_table_remark_005,
        mid_table_remark_006,
        mid_table_remark_007
    }
    if (pre_db_para_id_public_middle_table) {
        postData.pre_db_para_id_public_middle_table = pre_db_para_id_public_middle_table;
    }
    return request({
        url: '/duzikai_api_mgr_public_middle_table',
        method: 'post',
        data: Qs.stringify(postData)
    })
}
// 新增/编辑/删除设备
export function deviceMgr(data) {
    if (!data) {
        return Promise.reject();
    }
    let {
        mid_table_remark_001 = "",
            mid_table_remark_002 = "",
            mid_table_remark_003 = "",
            mid_table_remark_004 = "",
            mid_table_remark_005 = "",
            mid_table_remark_006 = "",
            mid_table_remark_007 = "",
            mid_table_remark_008 = "",
            mid_table_remark_009 = "",
            mid_table_remark_010 = "",
            mid_table_remark_011 = "",
            mid_table_remark_040 = "",
            mid_table_remark_041 = "",
            mid_table_remark_042 = "",
            mid_table_remark_043 = "",
            pre_db_para_id_public_middle_table = "",
            is_online = 0,
            type_inner_app = 1001,
            type_middle_app = 142001,
            pre_db_para_middle_table_name = 'public_middle_table_lite_mod_express_locker',
            invoke_method = 'public_insert_or_update_middle_table'
    } = data;
    //duzikai_api_mgr_public_middle_table?invoke_method=public_insert_or_update_middle_table&pre_db_para_middle_table_name=public_middle_table_lite_mod_express_locker&type_middle_app=141001&type_inner_app=1001
    let postData = {
        invoke_method,
        pre_db_para_middle_table_name,
        type_middle_app,
        type_inner_app,
        is_online,
        mid_table_remark_001,
        mid_table_remark_002,
        mid_table_remark_003,
        mid_table_remark_004,
        mid_table_remark_005,
        mid_table_remark_006,
        mid_table_remark_007,
        mid_table_remark_008,
        mid_table_remark_009,
        mid_table_remark_010,
        mid_table_remark_011,
        mid_table_remark_040,
        mid_table_remark_041,
        mid_table_remark_042,
        mid_table_remark_043,
    }
    if (pre_db_para_id_public_middle_table) {
        postData.pre_db_para_id_public_middle_table = pre_db_para_id_public_middle_table;
    }
    return request({
        url: '/duzikai_api_mgr_public_middle_table',
        method: 'post',
        data: Qs.stringify(postData)
    })
}
// 编辑/删除设备联动
export function deviceLinkage(data) {
    if (!data) {
        return Promise.reject();
    }
    let {
        mid_table_remark_009 = "",
            mid_table_remark_010 = "",
            mid_table_remark_011 = "",
            is_online = 0,
            pre_db_para_mid_table_remark_012 = "",
            pre_db_para_id_public_middle_table = -1,
            pre_db_para_type_middle_app_in = '143001',
            pre_db_para_middle_table_name = 'public_middle_table_lite_mod_express_locker',
            invoke_method = 'public_load_middle_table_list'
    } = data;
    //duzikai_api_mgr_public_middle_table?invoke_method=public_insert_or_update_middle_table&pre_db_para_middle_table_name=public_middle_table_lite_mod_express_locker&type_middle_app=141001&type_inner_app=1001
    let postData = {
        invoke_method,
        pre_db_para_middle_table_name,
        pre_db_para_type_middle_app_in,
        pre_db_para_mid_table_remark_012,
        is_online,
        mid_table_remark_009,
        mid_table_remark_010,
        mid_table_remark_011
    }
    if (pre_db_para_id_public_middle_table) {
        postData.pre_db_para_id_public_middle_table = pre_db_para_id_public_middle_table;
    }
    return request({
        url: '/duzikai_api_mgr_public_middle_table',
        method: 'post',
        data: Qs.stringify(postData)
    })
}

// 新增/编辑/删除箱格
// 新增/编辑/删除设备
export function crateMgr(data) {
    if (!data) {
        return Promise.reject();
    }
    let {
        mid_table_remark_001 = "",
            mid_table_remark_002 = "",
            mid_table_remark_003 = "",
            mid_table_remark_004 = "",
            mid_table_remark_005 = "",
            mid_table_remark_006 = "",
            mid_table_remark_007 = "",
            mid_table_remark_008 = "",
            mid_table_remark_009 = "",
            mid_table_remark_010 = "",
            mid_table_remark_011 = "",
            mid_table_remark_012 = "",
            mid_table_remark_013 = "",
            mid_table_remark_014 = "",
            mid_table_remark_040 = "",
            mid_table_remark_041 = "",
            mid_table_remark_042 = "",
            mid_table_remark_043 = "",
            pre_db_para_id_public_middle_table = "",
            is_online = 0,
            type_inner_app = 1001,
            type_middle_app = 143001,
            pre_db_para_middle_table_name = 'public_middle_table_lite_mod_express_locker',
            invoke_method = 'public_insert_or_update_middle_table'
    } = data;
    //duzikai_api_mgr_public_middle_table?invoke_method=public_insert_or_update_middle_table&pre_db_para_middle_table_name=public_middle_table_lite_mod_express_locker&type_middle_app=141001&type_inner_app=1001
    let postData = {
        invoke_method,
        pre_db_para_middle_table_name,
        type_middle_app,
        type_inner_app,
        is_online,
        mid_table_remark_001,
        mid_table_remark_002,
        mid_table_remark_003,
        mid_table_remark_004,
        mid_table_remark_005,
        mid_table_remark_006,
        mid_table_remark_007,
        mid_table_remark_008,
        mid_table_remark_009,
        mid_table_remark_010,
        mid_table_remark_011,
        mid_table_remark_012,
        mid_table_remark_013,
        mid_table_remark_014,
        mid_table_remark_040,
        mid_table_remark_041,
        mid_table_remark_042,
        mid_table_remark_043,
    }
    if (pre_db_para_id_public_middle_table) {
        postData.pre_db_para_id_public_middle_table = pre_db_para_id_public_middle_table;
    }
    return request({
        url: '/duzikai_api_mgr_public_middle_table',
        method: 'post',
        data: Qs.stringify(postData)
    })
}